{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
	<div class="main">
		{include admin.inc.menu}

		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				{include admin.inc.bread}

				<!-- Nav tabs -->

				<div class="inner-container">

					<form role="form" class="content-add-form form-horizontal" action="#" id="content-add-form" autocomplete="off">

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span>  服务名称</label>
							<div class="col-sm-10">
								<select class="form-control" name="data[appid]" id="appid" required>
									{loop $apps $value}
									<option value="{$value[id]}">{$value[name]}</option>
									{/loop}
								</select>
								<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">一级域名</label>
							<div class="col-sm-10">
								<input type="text" name="data[domain]" class="form-control" maxlength="30" placeholder="一级域名" />
								<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 二级域名</label>
							<div class="col-sm-10">
								<input type="text" name="data[level2_domain]" class="form-control" maxlength="20" placeholder="二级域名" required />
								<p class="help-block">只要填写前缀就好了，比如说app.dasu123.com只要写app就好了,不需要写dasu123.com，长度不超过20</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 联系人</label>
							<div class="col-sm-10">
								<input type="text" name="data[contacter]" class="form-control" maxlength="20" placeholder="联系人" required />
								<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 联系电话</label>
							<div class="col-sm-10">
								<input type="text" name="data[mobile]" dtype="mobile" class="form-control" maxlength="11" placeholder="联系电话" required />
								<p class="help-block"></p>
							</div>
						</div>


						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 后台登录名</label>
							<div class="col-sm-10">
								<input type="text" name="data[admin_user]" dtype="uname" class="form-control" maxlength="20" placeholder="登录名" message="后台登录名只能输入数字或者字母" required />
								<p class="help-block">登录名不超过20个字符</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 登录密码</label>
							<div class="col-sm-10">
								<input type="text" name="data[admin_pass]" dtype="pwd" class="form-control" min-length="6" maxlength="20" placeholder="MPE后台登录密码" required />
								<p class="help-block">密码为6-20位数字与字母组合字符</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 状态</label>
							<div class="col-sm-10">
								<p class="help-block"></p>
								<div class="bootstrap-switch-swrap">
									<input type="checkbox" class="bswitch bswitch-list" data-size="mini" checked data-on-text="启用" data-off-text="禁用">
									<input type="hidden" name="data[status]" value="1">
								</div>
								<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 开通期限</label>
							<div class="col-sm-10">
								<div class="form-inline">
									<input class="form-control mdate" name="data[start_time]" value="{expr date('Y-m-d')}" type="text" placeholder="开始时间">
									<span class="label label-default">到</span>
									<input class="form-control mdate" name="data[end_time]" type="text" placeholder="结束时间">
								</div>
								<p class="help-block">如果不选结束时间则表示永久开通</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span> 大塑账户授权</label>
							<div class="col-sm-10">
								<div>
									<span class="label label-primary" style="font-size: 16px;" id="username"></span>
									<a href="#" id="user-bind" class="btn btn-success">绑定</a> 或 <a href="/admin/paymentUser/add" class="btn btn-info">注册</a>
									<input type="hidden" name="data[userid]" empty-message="请绑定大塑账户账号" required>
									<input type="hidden" name="data[company]" empty-message="请绑定大塑账户账号" required>
								</div>
								<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="btn-group btn-group-or">
									<a href="{$insert_url}" class="btn btn-primary" id="submit_btn"
									   proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>
									<span class="or">OR</span>
									<button type="reset" class="btn btn-default">重置表单</button>
								</div>
							</div>
						</div>
					</form>

				</div>
			</div><!-- end of inner -->

		</section>

	</div>
</div>

{include admin.inc.footer}

<script type="text/html" id="user-band-template">

	<form role="form" class="content-add-form" action="#" id="account-bind-form" autocomplete="off">

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 大塑账户账号</label>
				<input type="text" name="account" class="form-control" placeholder="大塑账户账号" required />
			</div>
			<p class="help-block"></p>
		</div>
	</form>
</script>

<script>
	seajs.use("mpe", function(exports) {
		exports.init({});
	});
</script>
</body>
</html>
